<template>
  <div class="rickEvaluation-content">
          <div class="rickEvaluationBox">
                <div class="headerBox">
                      <div class="line"></div>
                      <div class="title">职业病综合风险评估报告</div>
                </div>
                <el-table :data="infoList" border>
                  <el-table-column label="用工单位名称" align="center" prop="enterpriseName" />
                  <el-table-column label="生成时间" align="center" prop="reportTime" /> 
                  <el-table-column label="得分" align="center" prop="score" />   
                      <el-table-column label="操作" align="center" prop="case" >
                        <template slot-scope="scope">
                                <el-button
                                size="mini"
                                type="text"
                                @click="handleDetail(scope.row)"
                                >下载查看</el-button>
                        </template>
                    </el-table-column > 
                </el-table>
                  <pagination
                  v-show="total>0"
                  :total="total"
                  :page.sync="queryParams.pageNum"
                  :limit.sync="queryParams.pageSize"
                  @pagination="getRickEvaluationFn"
                />
                <div class="bottomBtnCss">
                  <el-button @click="goBackBtn">返回</el-button>
                 </div>
          </div>
  </div>
</template>

<script>
import { getRickEvaluation} from "@/api/zhangping/occupational";
  export default {
    data() {
      return {
         infoList:[],
         queryParams:{
              creditCode:'', 
              pageNum: 1,
              pageSize: 10,
         },
         total:0
      };
    },
    created() {
        this.queryParams.creditCode = this.$route.query.creditCode
        this.getRickEvaluationFn()
    },
    methods: {
      getRickEvaluationFn(){
            getRickEvaluation(this.queryParams).then(res=>{
                  if(res.code == 200){
                        this.infoList = res.rows
                        this.total = res.total
                  }else{
                        this.$message.error(res.msg);  
                  }    
            })
        },
        handleDetail(item){
             window.open(item.fileUrl)
        },

        goBackBtn(){
          this.$router.back()
        },
    }
  };
</script>
<style lang="scss" scoped>
         .display-fx-center{
             display: flex;
             align-items: center;
         }
         .per100{
             width: 100%!important;
         }
         .soildTop{
             border-top:solid 1px  #D3D8E2;
         }
         .rickEvaluation-content{
              overflow-y: auto;
              position: relative;
              background-color: #fff;
              padding: 40px 20px;
              border-radius: 10px;
              height: calc( 100vh - 66px - 40px);
             .rickEvaluationBox{
                    padding-bottom:40px;

              }
           .headerBox{
                font-size: 16px;
                color: #484848;
                font-weight: bold;
                // margin-top:40px;/
                margin-bottom:15px;
                @extend .display-fx-center;
                .line{
                  width: 4px;
                  height: 12px;
                  background: #5D85FF;
                  border-radius: 6px 6px 6px 6px;
                  margin-right:6px;
                }
             }
          }
          .bottomBtnCss{
            // margin-top: auto;
            text-align: right;
            position: fixed;
            bottom: 40px;
            right: 40px; 
        }
        .pagination{
              @extend .display-fx-center;  
              justify-content: center;   
              margin-top:50px;     
        }
        ::v-deep{  
           .el-table__header-wrapper th{
                 background: #F4F8FF!important;       
           }
        }
        
</style>
